home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / 173c_utl.zip / FFS.DOC < prev    next >
Text File  |  1989-11-05  |  6KB  |  134 lines

  1. Supplemental Documenation for RBBS 17.3
  2. Fast File Search
  3. by Ken Goosens, 10-22-89
  4.  
  5. RBBS 17.3 has a signficant enhancement to the way searches for a requested
  6. file are done in and upload and download.   This enhancement has two
  7. big improvements:
  8.  
  9. (a)  File searches are much faster.  In the case of very slow devices like
  10.      a CD-ROM, this can be the difference between sub-second response and
  11.      a 45 second response.   File searches are now virtually instantaneous.
  12.  
  13. (b)  File not stored on this system can trigger macros.   This allows
  14.      requests for files stored elsewhere, either off line on backups,
  15.      or on other cooperating systems, to trigger later processing.
  16.  
  17.  
  18. Fast File Searching
  19.  
  20. For directories DOS uses chained "buckets" in multiple locations, 
  21. searched sequentially.   This results in very slow performance when
  22. the number of files to search gets into the thousands.   RBBS now
  23. supports a fast file search than more than compensates for the
  24. inefficent operation in DOS.
  25.  
  26. The basis for the fast file search is a file, configuration
  27. parameter 267, which is a sorted list of file names available for
  28. downloading.    The default name is FIDX.DEF.
  29.  
  30. The format of this file is:
  31.  
  32. columns 1-12:  file name
  33. columns 13-16: location index (1, 2, 3, ...)
  34. columns 17-18: carriage return line feed.
  35.  
  36. All data is stored as character data and the file is editable.   The file
  37. names must be stored with no internal spaces and a period separating the
  38. prefix from the extension.   The list of file names MUST BE SORTED BY
  39. FILE NAME in order for the fast file search to work.
  40.  
  41. The location index is the record number (line number) of the locator file,
  42. whose default name is LIDX.DEF, and has the following layout:
  43.  
  44. columns 1-63:  location of file
  45. column  64:    any character.  MAKEFIDX puts in a period.
  46. columns 65-66: carriage return line feed.
  47.  
  48. This file is all character data and is editable.   Essentially, the location
  49. index points to a record in the location file.   E.g. if FIDX.DEF has
  50.  
  51. RBBS-BAS.ZIP   2
  52. HARPIE.ARC     3
  53.  
  54. and LIDX.DEF has
  55.  
  56. C:\DOWN1\
  57. C:\DOWN2\
  58. C:\UP\
  59.  
  60. Then RBBS-BAS.ZIP is located in directory C:\DOWN2 (2nd record) and 
  61. HARPIE.ARC is located in C:\UP (3rd record).
  62.  
  63. The location field should be a drive/path terminating with a "\" if
  64. any path is given, and file must be filled with blanks through column
  65. 63 if the path is shorter.  You must put some character in column 64.
  66. Many editors delete trailing blanks, so you should probably put in
  67. a non-blank.  A period is a suitable choice.
  68.  
  69. RBBS will use a binary search on the first 12 characters in FIDX.DEF.
  70. This binary search can be significantly speeded by provided "tabs" for
  71. this file, indicating the record at which the first file is that begins
  72. with the symbols "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".   This is like
  73. the "tabs" you see on dictionaries, so you can directly turn to the B's,
  74. for example.   A tab file has the same prefix as the file name file,
  75. except that it adds a "T".  For "FIDX.DEF", the tab file would be
  76. "FIDXT.DEF".   RBBS will automatically detect and use a tab file if
  77. available.   The tab has 72 characters in it.   Each 2 bytes represents
  78. a binary integer whose value is the record number in FIDX.DEF where the
  79. first file occurs that begins with the respective symbols above.  Thus
  80. bytes 3-4 show where files begin with "1" and bytes 69-70 where files
  81. begin with "Y".
  82.  
  83. Two utilities with source code are provided for setting up the fast file
  84. searches.   The source, for compiling under QB 4.5, is included.
  85.  
  86. MAKEFIDX will create both the file name list (FIDX.DEF) and the
  87. location file (LIDX.DEF), from a list of directories (see MAKEFIDX.CFG)
  88. or a list of file names, or both.
  89.  
  90. You must next sort FIDX.DEF by file name.  A good shareware utility for
  91. this is QSORT (QSORT FIDX.DEF /1:12).
  92.  
  93. MAKETABS will create a tab file (FIDXT.DEF) from the sorted file list
  94. FIDX.DEF.
  95.  
  96. The batch file I use for recreating my fast file system is MAKEFFS.BAT.
  97. It uses MAKEFIDX.EXE, QSORT.EXE, MAKETABS.EXE, and configuration file
  98. MAKEFIDX.KG.   You need only edit MAKEFIDX.KG to change the filespecs
  99. (/FileSpec=) to match where your files are, and where to write the
  100. index files.
  101.  
  102.  
  103. Reconfiguring to Take Maximal Advantage of Fast File Searches
  104.  
  105. The fast file search is virtually instantaneous on an 8088 with a tab
  106. file for 5000 file entries.   The savings on wear and tear on the hard
  107. disk can be very significant as well.   And the time it takes to set up
  108. the fast file search is only a few minutes.  Most sysops, therefore, will
  109. want to implment fast file searching, whether or not they have a slow
  110. device like a CD-ROM.
  111.  
  112. RBBS will first search through the drive/paths specified in config
  113. to be available for downloading, as it always did.   Files not found
  114. there will then be searched using the fast file search system.
  115. The way the fast file search works is that a file found in its list is
  116. looked for only in the designated location.  Nothing else is searched.
  117.  
  118. The optimal way to implement fast file searching is to reconfigure the
  119. drive/pathes available for downloading down to at most the upload
  120. directory, and let the fast file search handle everything else.   That
  121. way, files will be searched first in the upload area, and those not found
  122. at first will then be searched using the fast file search system.
  123. Note that every file in the fast file search list is considered
  124. to be available for downloading whether or not its drive/path
  125. is listed in the configuration program as a downloadable area.   Note
  126. that you can have separate fast file search systems available for each
  127. subboard, if desired.   You can also use the fast file search for common
  128. files and have a separate download area for the subboards.
  129.  
  130. Note:  whenever you relocate files, you must re-create the fast file
  131. search system.   This is not hard since it takes little time and can be
  132. automated.
  133.  
  134.